using System.Collections.Generic;
using UnityEngine;

namespace PKGames.Analytics
{
	public class FasterLoggerAndroid : PluginAndroid, IAnalyticsLogger
	{
		private const string JavaPackageName = "com.movile.playkids.unityInterfaces";

		private const string JavaClassName = "FasterLoggerPluginUnityInterface";

		private const string LogEventMethodName = "LogEvent";

		public FasterLoggerAndroid()
			: base("com.movile.playkids.unityInterfaces", "FasterLoggerPluginUnityInterface")
		{
		}

		public void LogEvent(string eventId, int eventRevision)
		{
			CallStaticMethod("LogEvent", eventRevision);
		}

		public void LogEvent(string eventId, Dictionary<string, UnityEncodedPrimitiveData> parameters, int eventRevision)
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			foreach (KeyValuePair<string, UnityEncodedPrimitiveData> parameter in parameters)
			{
				dictionary[parameter.Key] = JsonUtility.ToJson(parameter.Value);
			}
			CallStaticMethod("LogEvent", eventId, dictionary, eventRevision);
		}
	}
}
